/*
using MyGeneration/Template/NHibernate (c) by Sharp 1.4
based on OHM (alvy77@hotmail.com)
*/
using System;
using System.Collections;
using System.Collections.Generic;

namespace DomainModel
{

	/// <summary>
	/// IUserInfo interface for NHibernate mapped table 'UserInfo'.
	/// </summary>
	public interface IUserInfo
	{
		#region Public Properties
		
		int u_id
		{
			get ;
			set ;
			  
		}
		
		string u_nick
		{
			get ;
			set ;
			  
		}
		
		string u_pass
		{
			get ;
			set ;
			  
		}
		
		byte u_from
		{
			get ;
			set ;
			  
		}
		
		DateTime u_registTime
		{
			get ;
			set ;
			  
		}
		
		string u_number
		{
			get ;
			set ;
			  
		}
		
		string u_name
		{
			get ;
			set ;
			  
		}
		
		string u_enName
		{
			get ;
			set ;
			  
		}
		
		int u_jwclass
		{
			get ;
			set ;
			  
		}
		
		string u_papers
		{
			get ;
			set ;
			  
		}
		
		DateTime? u_birthday
		{
			get ;
			set ;
			  
		}
        DateTime? u_vipUpdateTime
        {
            get;
            set;

        }
		int? u_age
		{
			get ;
			set ;
			  
		}
		
		byte? u_sex
		{
			get ;
			set ;
			  
		}
		
		string u_school
		{
			get ;
			set ;
			  
		}
		
		string u_class
		{
			get ;
			set ;
			  
		}
		
		string u_english
		{
			get ;
			set ;
			  
		}
		
		string u_patriarchName1
		{
			get ;
			set ;
			  
		}
		
		string u_raletion1
		{
			get ;
			set ;
			  
		}
		
		string u_tel1
		{
			get ;
			set ;
			  
		}
		
		int? u_patriarchAge1
		{
			get ;
			set ;
			  
		}
		
		string u_patriarchEducation1
		{
			get ;
			set ;
			  
		}
		
		string u_job1
		{
			get ;
			set ;
			  
		}
		
		string u_post1
		{
			get ;
			set ;
			  
		}
		
		string u_patriarchName2
		{
			get ;
			set ;
			  
		}
		
		string u_raletion2
		{
			get ;
			set ;
			  
		}
		
		string u_tel2
		{
			get ;
			set ;
			  
		}
		
		int? u_patriarchAge2
		{
			get ;
			set ;
			  
		}
		
		string u_patriarchEducation2
		{
			get ;
			set ;
			  
		}
		
		string u_job2
		{
			get ;
			set ;
			  
		}
		
		string u_post2
		{
			get ;
			set ;
			  
		}
		
		string u_address
		{
			get ;
			set ;
			  
		}
		
		string u_email
		{
			get ;
			set ;
			  
		}
		
		byte? u_state
		{
			get ;
			set ;
			  
		}
		
		DateTime? u_time
		{
			get ;
			set ;
			  
		}
		
		string u_teacher1
		{
			get ;
			set ;
			  
		}
		
		string u_teacher2
		{
			get ;
			set ;
			  
		}
		
		string u_studyTime1
		{
			get ;
			set ;
			  
		}
		
		string u_studyTime2
		{
			get ;
			set ;
			  
		}
		
		int u_vip
		{
			get ;
			set ;
			  
		}
		
		int? u_user
		{
			get ;
			set ;
			  
		}
		
		DateTime u_addTime
		{
			get ;
			set ;
			  
		}
		
		int? u_lastUser
		{
			get ;
			set ;
			  
		}
		
		DateTime? u_updateTime
		{
			get ;
			set ;
			  
		}
		
		bool IsDeleted { get; set; }
		bool IsChanged { get; set; }
		
		#endregion 
	}

	/// <summary>
	/// UserInfo object for NHibernate mapped table 'UserInfo'.
	/// </summary>
	[Serializable]
	public class UserInfo : ICloneable,IUserInfo
	{
		#region Member Variables

		protected int _u_id;
		protected string _u_nick;
		protected string _u_pass;
		protected byte _u_from;
		protected DateTime _u_registtime;
		protected string _u_number;
		protected string _u_name;
		protected string _u_enname;
		protected int _u_jwclass;
		protected string _u_papers;
		protected DateTime? _u_birthday;
        protected DateTime? _u_vipupdatetime;
		protected int? _u_age;
		protected byte? _u_sex;
		protected string _u_school;
		protected string _u_class;
		protected string _u_english;
		protected string _u_patriarchname1;
		protected string _u_raletion1;
		protected string _u_tel1;
		protected int? _u_patriarchage1;
		protected string _u_patriarcheducation1;
		protected string _u_job1;
		protected string _u_post1;
		protected string _u_patriarchname2;
		protected string _u_raletion2;
		protected string _u_tel2;
		protected int? _u_patriarchage2;
		protected string _u_patriarcheducation2;
		protected string _u_job2;
		protected string _u_post2;
		protected string _u_address;
		protected string _u_email;
		protected byte? _u_state;
		protected DateTime? _u_time;
		protected string _u_teacher1;
		protected string _u_teacher2;
		protected string _u_studytime1;
		protected string _u_studytime2;
		protected int _u_vip;
		protected int? _u_user;
		protected DateTime _u_addtime;
		protected int? _u_lastuser;
		protected DateTime? _u_updatetime;
		protected bool _bIsDeleted;
		protected bool _bIsChanged;
		#endregion
		
		#region Constructors
		public UserInfo() {}
		
		public UserInfo(string punick, string pupass, byte pufrom, DateTime puregistTime, string punumber, string puname, string puenName, int pujwclass, string pupapers, DateTime? pubirthday, int? puage, byte? pusex, string puschool, string puclass, string puenglish, string pupatriarchName1, string puraletion1, string putel1, int? pupatriarchAge1, string pupatriarchEducation1, string pujob1, string pupost1, string pupatriarchName2, string puraletion2, string putel2, int? pupatriarchAge2, string pupatriarchEducation2, string pujob2, string pupost2, string puaddress, string puemail, byte? pustate, DateTime? putime, string puteacher1, string puteacher2, string pustudyTime1, string pustudyTime2, int puvip, int? puuser, DateTime puaddTime, int? pulastUser, DateTime? puupdateTime,DateTime?puvipUpdateTime)
		{
			this._u_nick = punick; 
			this._u_pass = pupass; 
			this._u_from = pufrom; 
			this._u_registtime = puregistTime; 
			this._u_number = punumber; 
			this._u_name = puname; 
			this._u_enname = puenName; 
			this._u_jwclass = pujwclass; 
			this._u_papers = pupapers; 
			this._u_birthday = pubirthday; 
			this._u_age = puage; 
			this._u_sex = pusex; 
			this._u_school = puschool; 
			this._u_class = puclass; 
			this._u_english = puenglish; 
			this._u_patriarchname1 = pupatriarchName1; 
			this._u_raletion1 = puraletion1; 
			this._u_tel1 = putel1; 
			this._u_patriarchage1 = pupatriarchAge1; 
			this._u_patriarcheducation1 = pupatriarchEducation1; 
			this._u_job1 = pujob1; 
			this._u_post1 = pupost1; 
			this._u_patriarchname2 = pupatriarchName2; 
			this._u_raletion2 = puraletion2; 
			this._u_tel2 = putel2; 
			this._u_patriarchage2 = pupatriarchAge2; 
			this._u_patriarcheducation2 = pupatriarchEducation2; 
			this._u_job2 = pujob2; 
			this._u_post2 = pupost2; 
			this._u_address = puaddress; 
			this._u_email = puemail; 
			this._u_state = pustate; 
			this._u_time = putime; 
			this._u_teacher1 = puteacher1; 
			this._u_teacher2 = puteacher2; 
			this._u_studytime1 = pustudyTime1; 
			this._u_studytime2 = pustudyTime2; 
			this._u_vip = puvip; 
			this._u_user = puuser; 
			this._u_addtime = puaddTime; 
			this._u_lastuser = pulastUser; 
			this._u_updatetime = puupdateTime;
            this._u_vipupdatetime = puvipUpdateTime;
		}
		
		public UserInfo(byte pufrom, DateTime puregistTime, int pujwclass, int puvip)
		{
			this._u_from = pufrom; 
			this._u_registtime = puregistTime; 
			this._u_jwclass = pujwclass; 
			this._u_vip = puvip; 
		}
		
		public UserInfo(int puid)
		{
			this._u_id = puid; 
		}
		
		#endregion
		
		#region Public Properties
		
		public virtual int u_id
		{
			get { return _u_id; }
			set { _bIsChanged |= (_u_id != value); _u_id = value; }
			
		}
		
		public virtual string u_nick
		{
			get { return _u_nick; }
			set 
			{
			  if (value != null && value.Length > 20)
			    throw new ArgumentOutOfRangeException("u_nick", "u_nick value, cannot contain more than 20 characters");
			  _bIsChanged |= (_u_nick != value); 
			  _u_nick = value; 
			}
			
		}
		
		public virtual string u_pass
		{
			get { return _u_pass; }
			set 
			{
			  if (value != null && value.Length > 32)
			    throw new ArgumentOutOfRangeException("u_pass", "u_pass value, cannot contain more than 32 characters");
			  _bIsChanged |= (_u_pass != value); 
			  _u_pass = value; 
			}
			
		}
		
		public virtual byte u_from
		{
			get { return _u_from; }
			set { _bIsChanged |= (_u_from != value); _u_from = value; }
			
		}
		
		public virtual DateTime u_registTime
		{
			get { return _u_registtime; }
			set { _bIsChanged |= (_u_registtime != value); _u_registtime = value; }
			
		}
		
		public virtual string u_number
		{
			get { return _u_number; }
			set 
			{
			  if (value != null && value.Length > 40)
			    throw new ArgumentOutOfRangeException("u_number", "u_number value, cannot contain more than 40 characters");
			  _bIsChanged |= (_u_number != value); 
			  _u_number = value; 
			}
			
		}
		
		public virtual string u_name
		{
			get { return _u_name; }
			set 
			{
			  if (value != null && value.Length > 20)
			    throw new ArgumentOutOfRangeException("u_name", "u_name value, cannot contain more than 20 characters");
			  _bIsChanged |= (_u_name != value); 
			  _u_name = value; 
			}
			
		}
		
		public virtual string u_enName
		{
			get { return _u_enname; }
			set 
			{
			  if (value != null && value.Length > 20)
			    throw new ArgumentOutOfRangeException("u_enName", "u_enName value, cannot contain more than 20 characters");
			  _bIsChanged |= (_u_enname != value); 
			  _u_enname = value; 
			}
			
		}
		
		public virtual int u_jwclass
		{
			get { return _u_jwclass; }
			set { _bIsChanged |= (_u_jwclass != value); _u_jwclass = value; }
			
		}
		
		public virtual string u_papers
		{
			get { return _u_papers; }
			set 
			{
			  if (value != null && value.Length > 20)
			    throw new ArgumentOutOfRangeException("u_papers", "u_papers value, cannot contain more than 20 characters");
			  _bIsChanged |= (_u_papers != value); 
			  _u_papers = value; 
			}
			
		}
		
		public virtual DateTime? u_birthday
		{
			get { return _u_birthday; }
			set { _bIsChanged |= (_u_birthday != value); _u_birthday = value; }
			
		}
		
		public virtual int? u_age
		{
			get { return _u_age; }
			set { _bIsChanged |= (_u_age != value); _u_age = value; }
			
		}
		
		public virtual byte? u_sex
		{
			get { return _u_sex; }
			set { _bIsChanged |= (_u_sex != value); _u_sex = value; }
			
		}
		
		public virtual string u_school
		{
			get { return _u_school; }
			set 
			{
			  if (value != null && value.Length > 50)
			    throw new ArgumentOutOfRangeException("u_school", "u_school value, cannot contain more than 50 characters");
			  _bIsChanged |= (_u_school != value); 
			  _u_school = value; 
			}
			
		}
		
		public virtual string u_class
		{
			get { return _u_class; }
			set 
			{
			  if (value != null && value.Length > 20)
			    throw new ArgumentOutOfRangeException("u_class", "u_class value, cannot contain more than 20 characters");
			  _bIsChanged |= (_u_class != value); 
			  _u_class = value; 
			}
			
		}
		
		public virtual string u_english
		{
			get { return _u_english; }
			set 
			{
			  if (value != null && value.Length > 200)
			    throw new ArgumentOutOfRangeException("u_english", "u_english value, cannot contain more than 200 characters");
			  _bIsChanged |= (_u_english != value); 
			  _u_english = value; 
			}
			
		}
		
		public virtual string u_patriarchName1
		{
			get { return _u_patriarchname1; }
			set 
			{
			  if (value != null && value.Length > 20)
			    throw new ArgumentOutOfRangeException("u_patriarchName1", "u_patriarchName1 value, cannot contain more than 20 characters");
			  _bIsChanged |= (_u_patriarchname1 != value); 
			  _u_patriarchname1 = value; 
			}
			
		}
		
		public virtual string u_raletion1
		{
			get { return _u_raletion1; }
			set 
			{
			  if (value != null && value.Length > 50)
			    throw new ArgumentOutOfRangeException("u_raletion1", "u_raletion1 value, cannot contain more than 50 characters");
			  _bIsChanged |= (_u_raletion1 != value); 
			  _u_raletion1 = value; 
			}
			
		}
		
		public virtual string u_tel1
		{
			get { return _u_tel1; }
			set 
			{
			  if (value != null && value.Length > 20)
			    throw new ArgumentOutOfRangeException("u_tel1", "u_tel1 value, cannot contain more than 20 characters");
			  _bIsChanged |= (_u_tel1 != value); 
			  _u_tel1 = value; 
			}
			
		}
		
		public virtual int? u_patriarchAge1
		{
			get { return _u_patriarchage1; }
			set { _bIsChanged |= (_u_patriarchage1 != value); _u_patriarchage1 = value; }
			
		}
		
		public virtual string u_patriarchEducation1
		{
			get { return _u_patriarcheducation1; }
			set 
			{
			  if (value != null && value.Length > 20)
			    throw new ArgumentOutOfRangeException("u_patriarchEducation1", "u_patriarchEducation1 value, cannot contain more than 20 characters");
			  _bIsChanged |= (_u_patriarcheducation1 != value); 
			  _u_patriarcheducation1 = value; 
			}
			
		}
		
		public virtual string u_job1
		{
			get { return _u_job1; }
			set 
			{
			  if (value != null && value.Length > 50)
			    throw new ArgumentOutOfRangeException("u_job1", "u_job1 value, cannot contain more than 50 characters");
			  _bIsChanged |= (_u_job1 != value); 
			  _u_job1 = value; 
			}
			
		}
		
		public virtual string u_post1
		{
			get { return _u_post1; }
			set 
			{
			  if (value != null && value.Length > 20)
			    throw new ArgumentOutOfRangeException("u_post1", "u_post1 value, cannot contain more than 20 characters");
			  _bIsChanged |= (_u_post1 != value); 
			  _u_post1 = value; 
			}
			
		}
		
		public virtual string u_patriarchName2
		{
			get { return _u_patriarchname2; }
			set 
			{
			  if (value != null && value.Length > 20)
			    throw new ArgumentOutOfRangeException("u_patriarchName2", "u_patriarchName2 value, cannot contain more than 20 characters");
			  _bIsChanged |= (_u_patriarchname2 != value); 
			  _u_patriarchname2 = value; 
			}
			
		}
		
		public virtual string u_raletion2
		{
			get { return _u_raletion2; }
			set 
			{
			  if (value != null && value.Length > 50)
			    throw new ArgumentOutOfRangeException("u_raletion2", "u_raletion2 value, cannot contain more than 50 characters");
			  _bIsChanged |= (_u_raletion2 != value); 
			  _u_raletion2 = value; 
			}
			
		}
		
		public virtual string u_tel2
		{
			get { return _u_tel2; }
			set 
			{
			  if (value != null && value.Length > 20)
			    throw new ArgumentOutOfRangeException("u_tel2", "u_tel2 value, cannot contain more than 20 characters");
			  _bIsChanged |= (_u_tel2 != value); 
			  _u_tel2 = value; 
			}
			
		}
		
		public virtual int? u_patriarchAge2
		{
			get { return _u_patriarchage2; }
			set { _bIsChanged |= (_u_patriarchage2 != value); _u_patriarchage2 = value; }
			
		}
		
		public virtual string u_patriarchEducation2
		{
			get { return _u_patriarcheducation2; }
			set 
			{
			  if (value != null && value.Length > 20)
			    throw new ArgumentOutOfRangeException("u_patriarchEducation2", "u_patriarchEducation2 value, cannot contain more than 20 characters");
			  _bIsChanged |= (_u_patriarcheducation2 != value); 
			  _u_patriarcheducation2 = value; 
			}
			
		}
		
		public virtual string u_job2
		{
			get { return _u_job2; }
			set 
			{
			  if (value != null && value.Length > 50)
			    throw new ArgumentOutOfRangeException("u_job2", "u_job2 value, cannot contain more than 50 characters");
			  _bIsChanged |= (_u_job2 != value); 
			  _u_job2 = value; 
			}
			
		}
		
		public virtual string u_post2
		{
			get { return _u_post2; }
			set 
			{
			  if (value != null && value.Length > 20)
			    throw new ArgumentOutOfRangeException("u_post2", "u_post2 value, cannot contain more than 20 characters");
			  _bIsChanged |= (_u_post2 != value); 
			  _u_post2 = value; 
			}
			
		}
		
		public virtual string u_address
		{
			get { return _u_address; }
			set 
			{
			  if (value != null && value.Length > 200)
			    throw new ArgumentOutOfRangeException("u_address", "u_address value, cannot contain more than 200 characters");
			  _bIsChanged |= (_u_address != value); 
			  _u_address = value; 
			}
			
		}
		
		public virtual string u_email
		{
			get { return _u_email; }
			set 
			{
			  if (value != null && value.Length > 50)
			    throw new ArgumentOutOfRangeException("u_email", "u_email value, cannot contain more than 50 characters");
			  _bIsChanged |= (_u_email != value); 
			  _u_email = value; 
			}
			
		}
		
		public virtual byte? u_state
		{
			get { return _u_state; }
			set { _bIsChanged |= (_u_state != value); _u_state = value; }
			
		}
		
		public virtual DateTime? u_time
		{
			get { return _u_time; }
			set { _bIsChanged |= (_u_time != value); _u_time = value; }
			
		}
		
		public virtual string u_teacher1
		{
			get { return _u_teacher1; }
			set 
			{
			  if (value != null && value.Length > 50)
			    throw new ArgumentOutOfRangeException("u_teacher1", "u_teacher1 value, cannot contain more than 50 characters");
			  _bIsChanged |= (_u_teacher1 != value); 
			  _u_teacher1 = value; 
			}
			
		}
		
		public virtual string u_teacher2
		{
			get { return _u_teacher2; }
			set 
			{
			  if (value != null && value.Length > 50)
			    throw new ArgumentOutOfRangeException("u_teacher2", "u_teacher2 value, cannot contain more than 50 characters");
			  _bIsChanged |= (_u_teacher2 != value); 
			  _u_teacher2 = value; 
			}
			
		}
		
		public virtual string u_studyTime1
		{
			get { return _u_studytime1; }
			set 
			{
			  if (value != null && value.Length > 100)
			    throw new ArgumentOutOfRangeException("u_studyTime1", "u_studyTime1 value, cannot contain more than 100 characters");
			  _bIsChanged |= (_u_studytime1 != value); 
			  _u_studytime1 = value; 
			}
			
		}
		
		public virtual string u_studyTime2
		{
			get { return _u_studytime2; }
			set 
			{
			  if (value != null && value.Length > 100)
			    throw new ArgumentOutOfRangeException("u_studyTime2", "u_studyTime2 value, cannot contain more than 100 characters");
			  _bIsChanged |= (_u_studytime2 != value); 
			  _u_studytime2 = value; 
			}
			
		}
		
		public virtual int u_vip
		{
			get { return _u_vip; }
			set { _bIsChanged |= (_u_vip != value); _u_vip = value; }
			
		}
		
		public virtual int? u_user
		{
			get { return _u_user; }
			set { _bIsChanged |= (_u_user != value); _u_user = value; }
			
		}
		
		public virtual DateTime u_addTime
		{
			get { return _u_addtime; }
			set { _bIsChanged |= (_u_addtime != value); _u_addtime = value; }
			
		}

        public virtual DateTime? u_vipUpdateTime
        {
            get { return _u_vipupdatetime; }
            set { _bIsChanged |= (_u_vipupdatetime != value); _u_vipupdatetime = value; }

        }
		public virtual int? u_lastUser
		{
			get { return _u_lastuser; }
			set { _bIsChanged |= (_u_lastuser != value); _u_lastuser = value; }
			
		}
		
		public virtual DateTime? u_updateTime
		{
			get { return _u_updatetime; }
			set { _bIsChanged |= (_u_updatetime != value); _u_updatetime = value; }
			
		}
		

		public virtual bool IsDeleted
		{
			get
			{
				return _bIsDeleted;
			}
			set
			{
				_bIsDeleted = value;
			}
		}
		
		public virtual bool IsChanged
		{
			get
			{
				return _bIsChanged;
			}
			set
			{
				_bIsChanged = value;
			}
		}
		
		#endregion 
		
		#region Equals And HashCode Overrides
		/// <summary>
		/// local implementation of Equals based on unique value members
		/// </summary>
		public override bool Equals( object obj )
		{
			if( this == obj ) return true;
			UserInfo castObj = null;
			try
			{
				castObj = (UserInfo)obj;
			} catch(Exception) { return false; } 
			return ( castObj != null ) &&
				( this._u_id == castObj.u_id );
		}
		/// <summary>
		/// local implementation of GetHashCode based on unique value members
		/// </summary>
		public override int GetHashCode()
		{
		  
			
			int hash = 57; 
			hash = 27 * hash * _u_id.GetHashCode();
			return hash; 
		}
		#endregion
		
		#region ICloneable methods
		
		public virtual object Clone()
		{
			return this.MemberwiseClone();
		}
		
		#endregion
	}
	
	#region Custom ICollection interface for UserInfo 

	
	public interface IUserInfoCollection : ICollection
	{
		UserInfo this[int index]{	get; set; }
		void Add(UserInfo pUserInfo);
		void Clear();
	}
	
	[Serializable]
	public class UserInfoCollection : IUserInfoCollection
	{
		private IList<UserInfo> _arrayInternal;

		public UserInfoCollection()
		{
			_arrayInternal = new List<UserInfo>();
		}
		
		public UserInfoCollection( IList<UserInfo> pSource )
		{
			_arrayInternal = pSource;
			if(_arrayInternal == null)
			{
				_arrayInternal = new List<UserInfo>();
			}
		}

		public UserInfo this[int index]
		{
			get
			{
				return _arrayInternal[index];
			}
			set
			{
				_arrayInternal[index] = value;
			}
		}

		public int Count { get { return _arrayInternal.Count; } }
		public bool IsSynchronized { get { return false; } }
		public object SyncRoot { get { return _arrayInternal; } }
		public void CopyTo(Array array, int index){ _arrayInternal.CopyTo((UserInfo[])array, index); }
		public IEnumerator GetEnumerator() { return _arrayInternal.GetEnumerator(); }
		public void Add(UserInfo pUserInfo) { _arrayInternal.Add(pUserInfo); }
		public void Clear() { _arrayInternal.Clear(); }
		public IList<UserInfo> GetList() { return _arrayInternal; }
	 }
	
	#endregion
}
